
If you compile, but DON'T link, useFunctions.c, you will see
that the compiler can use the definition of myFunction() from
myFunctions.h to completely compile the call to myFunction().
Compare this to the example in the other folder, where the
compiler only had a declaration for myFunction(), so the
compiler didn't know where the definition of myFunction()
would come from, so the compiler left part of the call to
myFunction blank.

On the other hand, the compiler still does not know where the
definition (i.e., the actual code) for printf() will come from
nor where the code will be placed in memory. So the compiler
leaves a blank space in the actual compiled calls to printf()
(in the object file useFunctions.o).

After you link useFunctions.o to the C Standard Library,
then the linker fills in (in useFunctions.exe) the blank
space left by the compiler for the call to printf().

NOTE: In the real world, header files are often like the
      header file in this folder, a combination of function
      declarations and function definitions. Occasionally
      you see people put all their function definitions in
      a header file. This make linking easier and eliminates
      the need to give people object files with the function
      definitions. But putting all the function definitions
      in a header prevents some good programming practices.


Here are commands for every step of the compilation process
(including the preprocessor step, the compiling step,
the assembler step, and the linking step).

gcc -E      useFunctions.c  -o useFunctions.i    (preprocessor step)
gcc -S      useFunctions.i  -o useFunctions.s    (compiling step)
gcc -c      useFunctions.s  -o useFunctions.o    (assembling step)
objdump -d  useFunctions.o                       (look inside object file)
gcc         useFunctions.o  -o useFunctions.exe  (linking step)
objdump -d  useFunctions.exe



Without using the compiler driver as much.

cpp     useFunctions.c  -o useFunctions.i    (preprocessor step)
gcc -S  useFunctions.i  -o useFunctions.s    (compiling step)
as      useFunctions.s  -o useFunctions.o    (assembling step)
ld      useFunctions.o  -o useFunctions.exe  (linking step, but this doesn't work)
gcc     useFunctions.o  -o useFunctions.exe  (linking step)





With debugging information. This lets us mix the
original source code with the assembly code when
we look inside of the object files.

gcc -E      useFunctions.c  -o useFunctions.i
gcc -S -g   useFunctions.i  -o useFunctions.s
gcc -c -g   useFunctions.s  -o useFunctions.o
objdump -S  useFunctions.o
gcc         useFunctions.o  -o useFunctions.exe
objdump -S  useFunctions.exe
